package com.common.excel.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;

import java.util.Date;

/**
 * excel实体模板类列子
 *
 * @author zhou_xh
 */
@HeadRowHeight(value = 40) // 设值表头的行高
@ContentRowHeight(value = 20) // 设置内容的行高
@ColumnWidth(value = 20) // 设置单元个默认列宽
public class UserExcelEntity {
    public static final String bigTitle = "填写须知： \n" +
            "1.表头信息为固定结构，不可更改；以下示例行，导入前请先删除\n" +
            "2.请严格按照填写规则输入数据，不合规的数据无法成功导入";

    /**
     * 用户名
     */
    @ExcelProperty(value = {bigTitle, bigTitle, "用户名"}, index = 0)
    private String username;
    /**
     * 显示名称
     */
    @ExcelProperty(value = {bigTitle, bigTitle, "昵称"}, index = 1)
    private String nickname;
    /**
     * 密码
     */
    @ExcelProperty(value = {bigTitle, bigTitle, "密码"}, index = 2)
    private String password;
    /**
     * 邮箱
     */
    @ExcelProperty(value = {bigTitle, bigTitle, "邮箱"}, index = 3)
    private String email;
    /**
     * 头像
     */
    @ExcelProperty(value = {bigTitle, bigTitle, "头像"}, index = 4)
    private String avatar;
    /**
     * 0 正常
     * 1 禁用
     */
    @ExcelProperty(value = {bigTitle, bigTitle, "状态\r0正常,1 禁用"}, index = 5)
    private String status;
    /**
     * 注册时间 yyyy-MM-dd HH:mm:ss格式
     */
    @ExcelProperty(value = {bigTitle, bigTitle, "注册时间"}, index = 6)
    @ColumnWidth(value = 40)
    private Date createdTime;

    /**
     * 设置从哪一行开始读取
     *
     * @return 行数
     */
    public static int getRowNum() {
        return 3;
    }

    public static String getBigTitle() {
        return bigTitle;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }
}
